package com.afteryuan.engine.model;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import com.afteryuan.dao.BaseObject;

@Entity
@Table(name = "T_SCENEDATA")
public class SceneData extends BaseObject {
	
	private String id;
    public static final Integer DATA_NORMAL = 0;
    public static final Integer DATA_BLOCK = 1;
    
    private Integer data;
    private String dataXml;
    private Integer x;
    private Integer y;
    private Integer ox;
    private Integer oy;
    private Integer depth;
    private Integer func;
    private Scene scene;//所属场景
    private Long createTime;

    public SceneData(String id) {
        this.id = id;
    }
    public SceneData() {

    }


    @Id
    @GeneratedValue(generator = "system-uuid")
    @GenericGenerator(name = "system-uuid", strategy = "uuid")
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

 
    public Integer getData() {
		return data;
	}
	public void setData(Integer data) {
		this.data = data;
	}
	public String getDataXml() {
		return dataXml;
	}
	public void setDataXml(String dataXml) {
		this.dataXml = dataXml;
	}
	public Integer getX() {
		return x;
	}
	public void setX(Integer x) {
		this.x = x;
	}
	public Integer getY() {
		return y;
	}
	public void setY(Integer y) {
		this.y = y;
	}
	public Integer getOx() {
		return ox;
	}
	public void setOx(Integer ox) {
		this.ox = ox;
	}
	public Integer getOy() {
		return oy;
	}
	public void setOy(Integer oy) {
		this.oy = oy;
	}

	public Integer getDepth() {
		return depth;
	}
	public void setDepth(Integer depth) {
		this.depth = depth;
	}
	public Integer getFunc() {
		return func;
	}
	public void setFunc(Integer func) {
		this.func = func;
	}
	@ManyToOne
    @JoinColumn(name="scene_id") 
	public Scene getScene() {
		return scene;
	}

	public void setScene(Scene scene) {
		this.scene = scene;
	}

    public Long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SceneData that = (SceneData) o;
        if (id != null ? !id.equals(that.id) : that.id != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        return (id != null ? id.hashCode() : 0);
    }

    @Override
    public String toString() {
        return "SceneData{" +
        "id='" + id + '\'' +
        ", data=" + data +
        '}';
    }

}
